package cn.yuanqiao.archive.appManager.service;

import cn.yuanqiao.archive.appManager.domain.TenantFields;
import cn.yuanqiao.archive.appManager.domain.TenantMdataList;
import com.alibaba.fastjson2.JSONArray;

import java.util.List;
import java.util.Map;

/**
 * 元数据明细Service接口
 * 
 * @author yuanqiao
 * @date 2023-06-09
 */
public interface ITenantMdataListService
{
    /**
     * 查询元数据明细
     * 
     * @param id 元数据明细主键
     * @return 元数据明细
     */
    public TenantMdataList selectTenantMdataListById(Long id);

    Map<String,Object> selectTenantMdataListByIdAll(Long id);

    /**
     * 查询元数据明细列表
     * 
     * @param tenantMdataList 元数据明细
     * @return 元数据明细集合
     */
    public List<TenantMdataList> selectTenantMdataListList(TenantMdataList tenantMdataList);

    public List<TenantMdataList> selectTenantMdataListListByCategoryId(TenantMdataList tenantMdataList,Long categoryId);

    /**
     * 新增元数据明细
     * @return 结果
     */
    //public int insertTenantMdataList(HddaMDataList tenantMdataList);
    public int insertTenantMdataList(String ids,Long groupId);

    /**
     * 修改元数据明细
     * 
     * @param tenantMdataList 元数据明细
     * @return 结果
     */
    public int updateTenantMdataList(TenantMdataList tenantMdataList,String ids);

    /**
     * 批量删除元数据明细
     * 
     * @param ids 需要删除的元数据明细主键集合
     * @return 结果
     */
    public int deleteTenantMdataListByIds(Long[] ids);

    /**
     * 删除元数据明细信息
     * 
     * @param id 元数据明细主键
     * @return 结果
     */
    public int deleteTenantMdataListById(Long id);

    List<TenantFields> getGroupDataList(TenantFields yqfields, Long groupId);

    String copyIsRepeat(String ids, Long groupId,Integer type);

    int copyToGroup(String ids, Long groupId, Integer type);

    void importHddaMDataList(List<TenantMdataList> dataLists, Long groupId, Integer type);

    /**
     * 导出模板
     * @param groupId
     * @param type
     * @return
     */
    Map<Integer, Object> getIsExport(Long groupId, Integer type);

    List<Map<String,Object>> selectYqdaMdataListListforshy(Long groupId,Integer type,String fieldCaption,String fieldName,Long categoryId);

    Integer addmdatatoshy(JSONArray ids, Integer type, Long categoryId, Long groupId);

    Integer deletemdatafromshy(JSONArray ids, Integer type, Long categoryId, Long groupId);

    int batchUpdateTenantMdataList(TenantMdataList tenantMdataList, String ids);

    List<TenantMdataList> selectTenantMdataListListforexport(Long groupId, Integer type, String fieldName, List ids);
}
